import asyncio
import aioredis

async def sample_pool():
    pool = await aioredis.create_pool('redis://localhost:6379')
    val = await pool.execute('rpush', 'test','')
    print(val)
    val = await pool.execute('lpop', 'test')
    print(val)
    val = await pool.execute('lpop','test')
    print(val)

if __name__ == '__main__':
    asyncio.run(sample_pool())